package com.jimmy.medical.entity;

import java.util.ArrayList;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.IndexColumn;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;

/**
 * 合同
 * 
 * @author jimmy
 * @since 0.1
 */
@Entity
@Table(name = "contract")
public class Contract extends AbstractEntity {
	/** 会员编号,注意此处会员编号为开通合同的会员编号,但是一个合同下可以有多个会员*/
	@Column(name = "member_no", length = 50)
	private String memberNo; 
	/** 会员姓名,同会员编号*/
	@Column(name = "member_name", length = 50)
	private String memberName;
	/** 合同会员*/
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "member_id")
	@NotFound(action = NotFoundAction.IGNORE)
	private Member member;
	/** 会员类型*/
	@ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "member_type_id")
    @NotFound(action = NotFoundAction.IGNORE)
	private MemberType memberType;
	/** 合同类型*/
	@Column(name = "contract_type", length = 10)
	private String contractType; 
	/** 合同编号,当合同为卡充值的时候,合同编号为卡号*/
	@Column(name = "contract_no", length = 50)
	private String contractNo;
	
	@Column(name = "card_no", length = 50)
	private String cardNo;
	
	@Column(name = "card_type", length = 2)
	private String cardType;
	
	@Column(name = "passwd", length = 50)
	private String password;
	
	@Column(name = "create_time", length = 20)
	private String createTime;
	@Column(name = "create_user", length = 50)
	private String createUser;
	@Column(name = "update_time", length = 20)
	private String updateTime;
	@Column(name = "update_user", length = 50)
	private String updateUser;
	/** 合同生效时间*/
	@Column(name = "start_time", length = 20)
	private String startTime;
	/** 到期时间*/
	@Column(name = "expire_time", length = 20)
	private String expireTime;
	/** 状态*/
	private String status;
	
	public String getMemberNo() {
		return memberNo;
	}
	
	public void setMemberNo(String memberNo) {
		this.memberNo = memberNo;
	}
	
	public String getMemberName() {
		return memberName;
	}
	
	public void setMemberName(String memberName) {
		this.memberName = memberName;
	}
	
	public MemberType getMemberType() {
		return memberType;
	}

	public void setMemberType(MemberType memberType) {
		this.memberType = memberType;
	}

	public Member getMember() {
		return member;
	}

	public void setMember(Member member) {
		this.member = member;
	}

	public String getContractType() {
		return contractType;
	}
	public void setContractType(String contractType) {
		this.contractType = contractType;
	}
	public String getContractNo() {
		return contractNo;
	}
	public void setContractNo(String contractNo) {
		this.contractNo = contractNo;
	}

	public String getCardNo() {
		return cardNo;
	}

	public void setCardNo(String cardNo) {
		this.cardNo = cardNo;
	}

	public String getCardType() {
		return cardType;
	}

	public void setCardType(String cardType) {
		this.cardType = cardType;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getCreateTime() {
		return createTime;
	}
	public void setCreateTime(String createTime) {
		this.createTime = createTime;
	}
	public String getCreateUser() {
		return createUser;
	}
	public void setCreateUser(String createUser) {
		this.createUser = createUser;
	}
	public String getUpdateTime() {
		return updateTime;
	}
	public void setUpdateTime(String updateTime) {
		this.updateTime = updateTime;
	}
	public String getUpdateUser() {
		return updateUser;
	}
	public void setUpdateUser(String updateUser) {
		this.updateUser = updateUser;
	}
	public String getStartTime() {
		return startTime;
	}

	public void setStartTime(String startTime) {
		this.startTime = startTime;
	}

	public String getExpireTime() {
		return expireTime;
	}
	public void setExpireTime(String expireTime) {
		this.expireTime = expireTime;
	}
	public String getStatus() {
		return status;
	}
	public void setStatus(String status) {
		this.status = status;
	}
}
